import java.util.Scanner;

public class DateOfBirth 
{
	public static void Data(int day, int month, int year) 
	{
		int wd=0;
		if(month <= 2)
		{
			year=year-1; 
			day=day+3;	
		}
		
		wd = (1 + (day + year + year/4 - year/100 + year/400 + (31*month + 10)/12))%7;
		
		switch (wd)
		{
		case 0: {System.out.println("Your's day of birth was Sunday"); break;}
		case 1: {System.out.println("Your's day of birth was Monday"); break;}
		case 2: {System.out.println("Your's day of birth was Tuesday"); break;}
		case 3: {System.out.println("Your's day of birth was Wednesday"); break;}
		case 4: {System.out.println("Your's day of birth was Thursday"); break;}
		case 5: {System.out.println("Your's day of birth was Friday"); break;}
		case 6: {System.out.println("Your's day of birth was Saturday"); break;}
		}
	}


	public static void main(String[] args) 
	{
		Scanner sc = new Scanner(System.in);
		
		System.out.print("Enter your date of birth (date month year): ");
		
        int day = sc.nextInt();
        int month = sc.nextInt();
        int year = sc.nextInt();
        
        Data(day, month, year);
	}

}
